package datastructure.search;


/**
 * 顺序查找
 * @author lbw
 */
public class SeqSearch {

    public static void main(String[] args) {
        int[] arr = {1, 9, 11, -11, 34, 80};
        System.out.println(seqSearch(arr, 1));
    }

    public static int seqSearch(int[] arr, int value){
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == value){
                return i;
            }
        }
        return -1;
    }
}
